using System;
using System.Data.SQLite;
using io = System.IO;

namespace SocketTool.Dll.Base
{
    public class BaseDll
    {
        private string mDbFolderPath = string.Empty;
        private string mDbPath = string.Empty;
        private string mConnectionString = string.Empty;

        protected SQLiteConnection mSQLiteCon
        {
            get { return new SQLiteConnection(mConnectionString); }
        }

        public BaseDll(string dbName)
        {
            this.mDbFolderPath = io.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
                "SocketTool", "Db");
            this.mDbPath = io.Path.Combine(mDbFolderPath, $"{dbName}.db3");
            this.mConnectionString = $"Data Source={mDbPath}";
        }
    }
}